package com.czl.module_storehouse.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.czl.module_base.utils.NumberUtils;
import com.czl.module_storehouse.R;
import com.czl.module_storehouse.bean.PurchaseProjectListBean;

import java.util.List;

/**
 * @author xubin
 */
public class ViewOrderItemAdapter extends BaseQuickAdapter<PurchaseProjectListBean, BaseViewHolder> {

    public ViewOrderItemAdapter(int layoutResId, @Nullable List<PurchaseProjectListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, PurchaseProjectListBean item) {
        helper.setText(R.id.tv_name, item.getPurchaseName())
                .setText(R.id.tv_model, item.getModel())
                .setText(R.id.tv_count, "数量：" + item.getUnInstoreCount())
                .setText(R.id.tv_price, NumberUtils.decimalPoints(item.getPrice()))
                .setText(R.id.tv_money, "金额：" + NumberUtils.decimalPoints(item.getPurchaseMoney()));
    }
}
